Author – Mahesh Kumar, Cloud Engineer
Overview
Sometimes users face problems with debugging the application code base within Kubernetes. Every time the user would need to build a container image and then deploy it on Kubernetes, this makes troubleshooting applications difficult.Azure Dev Spaces
Azure Dev Spaces offers a solution for operating with a team on a container-based solution. It is an extension of AKS that permits developers to simply run and debug the code within the context of larger applications without effecting another environment, users can test application module inside the AKS with the help of Azure Dev Spaces and share a development cluster between team members with no interference. It provides the concept of a space, which allows working in isolation and without the fear of breaking the system. You can use Azure Dev Spaces with CLI, Visual Studio and Visual Studio Code. It’s very flexible and works with all environments.Prerequisites
- Azure subscription
- Visual Studio
- Azure CLI
- AKS cluster
$ az login
$ az account list –output table
$ az account set –subscription
$ az group create –name MyResourceGroup –location
$ az aks create -g MyResourceGroup -n MyAKS –location –generate-ssh-keys
Next, run the following command to install Azure CLI tools in your system:
$ az aks get-credentials -n -g
$ az aks use-dev-spaces -g MyResourceGroup -n MyAKS
Enabling Azure Dev Space for your Application
- Open up Visual Studio. (make sure Azure SDK is enabled in Visual Studio)
- Create a new ASP. Net core application
- Select Azure Dev Spaces at runtime
- After your selection there will be a prompt displayed to verify your subscription. Choose your correct subscription, AKS name and Dev Spaces namespace.
- After clicking on ok the bundling process will begin, and the below two files will be generated
- azds.yml
- Dockerfile
The azds.yml file contains Helm chart configuration, you can update this chart as per your requirement. The Dockerfile contains your container image configuration
6. When your project is running you can attach the debugger like this We have configured AKS dev spaces in our AKS cluster you can do similar for configure azure dev spaces in your AKS cluster.